/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package radio.sessions;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import radio.entities.AccountsType;

/**
 *
 * @author Huu Vinh
 */
@Stateless
public class AccountsTypeFacade extends AbstractFacade<AccountsType> {
    
    @PersistenceContext(unitName = "RadioCabsEJB-ejbPU")
    private EntityManager em;
    
    protected EntityManager getEntityManager() {
        return em;
    }
    
    public AccountsTypeFacade() {
        super(AccountsType.class);
    }
    
    public AccountsType getId(String typeName) {
        return (AccountsType) em.createNamedQuery("AccountsType.findByTypeName").setParameter("typeName", typeName).getResultList().get(0);
    }
}
